<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>H5中实现扫码</title>
</head>
<style>
    input {
        display: none;
    }
</style>

<body>
    <div>
        <div class="qr-btn" node-type="qr-btn">扫描二维码
            <input node-type="jsbridge" type="file" name="myPhoto" value="扫描二维码"/>
        </div>
        <!-- 输出二维码地址 -->
        <pre class="well result-qrcode" id="result"></pre>
    </div>
</body>
<script src="./js/jquery1.7.2.js"></script>
<script src="./js/qrcode.lib.min.js"></script>
<script src="./js/qrcode.min.js"></script>
<script>
    //初始化扫描二维码按钮，传入自定义的 node-type 属性
    $(function () {
        Qrcode.init($('[node-type=qr-btn]'));
    });
</script>

</html>